/* Error Codes [Speech recognition gets -5100 through -5199] */
enum {
eSRNotAvailable = -5100, /* the service requested is not avail or applicable */
eSRInternalError = -5101, /* a system internal or hardware error condition */
eSRComponentNotFound = -5102, /* a needed system resource was not located */
eSROutOfMemory = -5103, /* an out of memory error occurred in the toolbox memory space */
eSRNotASpeechObject = -5104, /* the object specified is no longer or never was valid */
eSRBadParameter = -5105, /* an invalid parameter was specified */
eSRParamOutOfRange = -5106, /* when we say 0-100, don't pass in 101. */
eSRBadSelector = -5107, /* an unrecognized selector was specified */
eSRBufferTooSmall = -5108, /* returned from attribute access functions */
eSRNotARecSystem = -5109, /* the object used was not a RecognitionSystem */
eSRFeedbackNotAvail = -5110, /* there is no feedback window associated with Recognizer */
eSRCantSetProperty = -5111, /* a non-settable property was specified */
eSRCantGetProperty = -5112, /* a non-gettable property was specified */
eSRCantSetDuringRecognition = -5113, /* the property can't be set while recognition is in progress -- do before or between utterances. */
eSRAlreadyListening = -5114, /* in response to SRStartListening */
eSRNotListeningState = -5115, /* in response to SRStopListening */
eSRModelMismatch = -5116, /* no acoustical models are avail to match request */
eSRNoClientLanguageModel = -5117, /* trying to access a non-specified LanguageModel */
eSRNoPendingUtterances = -5118, /* nothing to continue search on */
eSRRecognitionAborted = -5119, /* an abort error occurred during search */
eSRRecognitionDone = -5120, /* search has finished, but nothing was recognized */
eSROtherRecAlreadyModal = -5121, /* another recognizer is modal at the moment, so can't set this recognizer's kBlockModally property right now */
eSRHasNoSubItems = -5122, /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
eSRSubItemNotFound = -5123, /* returned when accessing a non-existent sub item of a container */
eSRLanguageModelTooBig = -5124, /* Cant build language models so big */
eSRAlreadyReleased = -5125, /* this object has already been released before */
eSRAlreadyFinished = -5126, /* the language model can't be finished twice */
eSRWordNotFound = -5127, /* the spelling couldn't be found in lookup(s) */
eSRNotFinishedWithRejection = -5128, /* property not found because the LMObj is not finished with rejection */
eSRExpansionTooDeep = -5129, /* Language model is left recursive or is embedded too many levels */
eSRTooManyElements = -5130, /* Too many elements added to phrase or path or other langauge model object */
eSRCantAdd = -5131, /* Can't add given type of object to the base LMObject (e.g.in SRAddLMObject) */
eSRSndInSourceDisconnected = -5132, /* Sound input source is disconnected */
/* non-release debugging error codes are included here */
eSRNotImplementedYet = -5199 /* you'd better wait for this feature in a future release */
};
/* Type Definitions */
typedef unsigned long SpeechObject;
typedef SpeechObject RecognitionSystem;
typedef SpeechObject Recognizer;
typedef SpeechObject SpeechSource;
typedef SpeechSource RecognitionResult;
typedef SpeechObject LMObject; /* an LMWord, LMPhrase or LanguageModel */
typedef LMObject LanguageModel;
typedef LMObject LMPath;
typedef LMObject LMPhrase;
typedef LMObject LMWord;
typedef unsigned long LMFlags;
typedef unsigned short SpeedSetting; /* between 0 and 100 */
typedef unsigned short RejectionLevel; /* between 0 and 100 */
typedef unsigned long UtteranceLength; /* a length measure in mS */
typedef unsigned long UtteranceCount; /* the number of queueable utterances */
/* When an event occurs, the user supplied proc will be called with a pointer
to the param passed in and a flag to indicate conditions such
as interrupt time or system background time.
*/
#if defined(powerc) || defined (__powerc)
#pragma options align=mac68k
#endif
struct SRCallBackStruct {
long what; /* one of notification flags */
long message; /* contains RecognitionResult id */
Recognizer instance; /* ID of recognizer being notified */
OSErr status; /* result status of last search */
short flags; /* non-zero if occurs during interrupt */
#define kRejectedWord 'rejq' /* the LMWord used to represent a rejection */
#define kSeparationChars 'spch' /* separation chars for current dialect setting -- use pointer to SeparationChars struct, defined in Dialect.h */
#define kFeedbackAndListeningModes 'fbwn' /* (short) one of kNoFeedbackHasListenModes, kHasFeedbackHasListenModes, kNoFeedbackNoListenModes */
/* kFeedbackAndListeningModes is only available in version 1.4 and later. */
#define kNoFeedbackNoListenModes 0 /* next allocated recognizer has no feedback window and doesn't use listening modes */
#define kHasFeedbackHasListenModes 1 /* next allocated recognizer has feedback window and uses listening modes */
#define kNoFeedbackHasListenModes 2 /* next allocated recognizer has no feedback window but does use listening modes */
/* Speech Source Types */
#define kSRDefaultSpeechSource ((OSType) 0)
/* Speech Source Properties */
/* Notification via Apple Event or Callback */
/* Notification Flags */
#define kNotifyRecognitionBeginning (1L<<0) /* recognition can begin. client must now call SRContinueRecognition or SRAbortRecognition */
#define kNotifyRecognitionDone (1L<<1) /* recognition has terminated. result (if any) is available. */
/* Apple Event selectors */
/* AppleEvent message class */
#define kAESpeechSuite 'sprc'
/* AppleEvent message event ids */
#define kAESpeechDone 'srsd'
#define kAESpeechDetected 'srbd'
/* AppleEvent Parameter ids */
#define keyRecognizer 'krec'
#define keySpeechResult 'kspr'
#define keySpeechStatus 'ksst'
/* AppleEvent Parameter types */
#define typeRecognizer 'trec'
#define typeSpeechResult 'tspr'
/* Recognizer Properties */
#define kSpeedVsAccuracyParam 'sped' /* SpeedSetting between 0 and 100 */
/* 0 means more accurate but slower. */
/* 100 means (much) less accurate but faster. */
#define kSearchStatusParam 'stat' /* see status flags below */
#define kNotificationParam 'noti' /* see notification flags below */
#define kCallBackParam 'call' /* type SRCallBackParam */
#define kAutoFinishingParam 'afin' /* automatic finishing applied on LM for search */
#define kForegroundOnly 'fgon' /* Boolean. Default is true. If true, client recognizer only active when in foreground. */
#define kBlockBackground 'blbg' /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive. */
#define kBlockModally 'blmd' /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
#define kWantsTextFeedback 'txfb' /* Boolean. Default is true. If true, search results are posted to Feedback window */
#define kWantsDefaultFBResponse 'dfbr' /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
/* Operational Status Flags */
#define kIdleRecognizer (1L<<0) /* engine is not active */
#define kSearchInProgress (1L<<1) /* search is in progress */
#define kSearchWaitForAllClients (1L<<2) /* search is suspended waiting on all clients' input */
#define kMustAbortSearch (1L<<3) /* something has occurred (sound played, non-speech detected) requiring the search to abort */
#define kPendingSearch (1L<<4) /* we're about to start searching */
/* Recognition Result Properties */
#define kTEXTFormat 'TEXT' /* raw text in user supplied memory */
#define kLMPhraseFormat 'lmph' /* LMPhrase containing result words */
#define kLMPathFormat 'lmpt' /* LMPath containing result phrases or words */
#define kLanguageModelFormat 'lmfm' /* top level LanguageModel for post parse */
/* LMObject Family Properties */
#define kLMName 'name' /* name of a LanguageModel */
#define kSpelling 'spel' /* spelling of a LMWord or LMPhrase or LMPath, or name of a LanguageModel */
#define kLMObjType 'lmtp' /* Returns one of LMObject Types listed below */
#define kRefCon 'refc' /* 4 bytes of user storage */
#define kOptional 'optl' /* Boolean -- true if LMObject is optional */
#define kRepeatable 'rptb' /* Boolean -- true if LMObject is repeatable */
#define kRejectable 'rjbl' /* Boolean -- true if LMObject is rejectable (Recognition System's kRejectedWord
object can be returned in place of LMObject with this property) */
#define kPrimitive 'prim' /* Boolean -- determines what shows up in search result's list of primitives */
#define kRejectionLevel 'rjct' /* RejectionLevel between 0 and 100 */
#define kFinishingFlags 'finf' /* Please use kOptional, kRepeatable, and kRejetable instead. pass pointer to LMFlags. Being phased out of public interfaces. */
/* LM Object Types -- returned as kLMObjType property of language model objects */
#define kLMType 'lmob' /* LanguageModel */
#define kPathType 'path' /* LMPath */
#define kPhraseType 'phra' /* LMPhrase */
#define kWordType 'word' /* LMWord */
/* a normal and reasonable rejection level */
#define kDefaultLMRejectionLevel 50
/* Finishing Flags - used to make up LMFlags, which is used for kFinishingFlags and kAutoFinishingParam properties */
/* 4/10/95 These finishing flags are being phased out of the public interfaces. Please use kOptional, kRepeatable,
and kRejectable Boolean LMObject properties instead. Those Boolean properties are easier to use. */
/* bit zero is reserved */
#define kAddPauses (1L<<1) /* allows user to pause between words */
#define kAddRejection (1L<<2) /* unrecognized words will be rejected */
#define kAddNoise (1L<<3) /* allows a some noise at beginning or end of utterance */
#define kMakeOptional (1L<<4) /* contents of LM are optional */
#define kMakeRepeatable (1L<<5) /* contents of LM may be repeated 0 or more times */